﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
	xmlns:Extensions="clr-namespace:WinChrome.Extensions" 
    xmlns:Convertors="clr-namespace:WinChrome.Convertors"
    xmlns:UI="clr-namespace:WinChrome.UI"
    >
    <!--<local:DebugMultiConverter x:Key="debugMultiConv"/>-->
    <Convertors:LegibleJournalEntryConverter x:Key="LegibleJournalEntryConverter" />
    <Convertors:IsCurrentJournalEntryConverter x:Key="IsCurrentJournalEntryConverter" />

    <!-- Template for Navigate Journal Menu Items -->
    <DataTemplate x:Key="journalMenuItemTemplate">
        <DataTemplate.Resources>
            <Style TargetType="{x:Type TextBlock}">
                <Setter Property="Foreground" Value="Black" />
            </Style>
        </DataTemplate.Resources>
        <TextBlock Text="{Binding Converter={StaticResource LegibleJournalEntryConverter}}" 
                   FontWeight="{Binding Converter={StaticResource IsCurrentJournalEntryConverter}}"/>
        <!--Todo: Wants converting to an image-->
    </DataTemplate>

    <!-- 
      Style for MenuItems that are generated and bound to the collection of 
      journal entry objects that are returned by the JournalEntryUnifiedViewConverter 
      and set as the ItemsSource for the Navigate Journal menu item
    -->
    <Style x:Key="journalMenuItemContainerStyle">
        <Setter Property="MenuItem.Command" Value="NavigationCommands.NavigateJournal" />
        <Setter Property="MenuItem.CommandTarget" 
              Value="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type NavigationWindow}}}" />
        <Setter Property="MenuItem.CommandParameter" Value="{Binding RelativeSource={RelativeSource Self}}" />
    </Style>

</ResourceDictionary>